﻿using Lsk.Business.DTO;
using Lsk.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity.Core.Objects;

namespace Lsk.Business
{
    public class SaleLet
    {
        private Lsk.Data.lskEntities _entity;

        public SaleLet()
        {
            _entity = new lskEntities();
        }

        public string SaveSaleLet(UserSubmitInfoParameter data)
        {
            ObjectParameter refId = new ObjectParameter("RetID",typeof(string));
            //Users myEmail = new Users();
            //myEmail.SendEmail("chinteongtan@hotmail.com", "User Submit Listing", "HEllo");

            ObjectResult<string> result  = _entity.UserSubmitListing(data.name,data.phone,data.email,data.company,data.price.ToString(),data.address,data.address,data.submissionType,data.url1,data.photoId1,data.url2,data.photoId2,data.url3,data.photoId3,refId);
            
            return result.FirstOrDefault();
        }
    }
}
